#include "ConditionImpl.h"

ClassConditionImpl::ClassConditionImpl()
{
}

ClassConditionImpl::ClassConditionImpl(const string& _value)
	:value(_value)
{

}

ClassConditionImpl::~ClassConditionImpl()
{

}

Condition::ConditionType ClassConditionImpl::getConditionType()const
{
	return Condition::SAC_CLASS_CONDITION;
}

Condition* ClassConditionImpl::Copy()const
{
	return new ClassConditionImpl(value);
}

const string* ClassConditionImpl::getNameSpaceURI()const
{
	return NULL;
}

const string* ClassConditionImpl::getLocalName()const
{
	return NULL;
}

bool ClassConditionImpl::getSpecified()const
{
	return true;
}

const string* ClassConditionImpl::getValue()const
{
	return &value;
}

const string* ClassConditionImpl::toString()const
{
	string* result = NULL;
	try
	{
		result = new string;
		result->append(".");
		result->append(value);
	}catch(std::exception& e)
	{
		if(result)
			delete result;
		return NULL;
	}
	return result;
}
